﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LoginUser.aspx.cs" Inherits="TotalSport.LoginUser" Theme="default" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>::User Login::</title>
    <link href="Styles/Stylsheet.css" rel="stylesheet" type="text/css" />
    <link href="Styles/Popup.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/Popup.js" type="text/javascript"></script>
    <script src="Scripts/jquery-1.4.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">

        function spnmsg() {

            document.getElementById("SMessage").style.display = 'none';
        }
        function focused() {

            var aaa = document.getElementById("spnMsg");
            aaa.style.display = "none";
        }

        function sendPassword() {
            document.getElementById("loading").style.display = "block";
            var username = document.getElementById("txtuname").value;

            if (username != "") {

                //if (validate(txtEmail)) {
                var xmlhttp;
                if (window.XMLHttpRequest) {
                    // code for IE7+, Firefox, Chrome, Opera, Safari
                    xmlhttp = new XMLHttpRequest();
                }
                else {// code for IE6, IE5
                    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                xmlhttp.onreadystatechange = function () {
                    if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
                        document.getElementById("loading").style.display = "none";
                        document.getElementById("ErrorDiv").style.display = "block";
                        document.getElementById("ErrorDiv").innerHTML = xmlhttp.responseText;
                        document.getElementById("txtuname").value = "";
                        //                        document.getElementById("type").value = "";
                    }
                }
                xmlhttp.open("POST", "AJAX1/SendPassword.aspx?username=" + username, true);
                xmlhttp.send();
                document.getElementById("loading").style.display = "block";
            }
            else if (username == "") {
                document.getElementById("div7").style.display = "block";
                document.getElementById("div7").innerHTML = "Please Enter UserName";
                toggleDiv('div7', 1);
                return false;
            }
        } 
      


    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
    <div>
        <table class="MUserClass" align="center">
            <tr>
                <td colspan="3">
                    <img src="Images/logoimg.bmp" width="600px" />
                </td>
            </tr>
            <tr>
                <td align="center">
                    <br />
                    <br />
                    <div class="boxed">
                        <table class="MSUserClass" border="0" width="100%" cellpadding="2" cellspacing="2">
                            <tr>
                                <td style="background-color: #0678B6; -webkit-border-radius: 8px;" valign="middle">
                                    <%--<img src="Images/loginicon.gif" height="35px" width="50px" />--%>&nbsp;&nbsp;&nbsp;
                                    <asp:Label ID="Label1" runat="server" Text="Login" CssClass="lableSignUpform"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span id="SMessage" style="display: none" runat="server" class="spanErrorMsgs" width="400px">
                                    </span>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div>
                                        <table align="center" cellpadding="3" cellspacing="5" border="0" width="100%" class="MUserMClass">
                                            <tr>
                                                <td class="tdHclass" align="center">
                                                    <asp:Label ID="lblUsername" runat="server" Text="Username" CssClass="lableform"></asp:Label>
                                                </td>
                                                <td class="tdMclass">
                                                    :
                                                </td>
                                                <td class="tdRclass">
                                                    <asp:TextBox ID="txtUsername" runat="server" onfocus="spnmsg()"></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtUsername"
                                                        ErrorMessage="Please Enter your Username" Display="None"></asp:RequiredFieldValidator>
                                                    <asp:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" TargetControlID="RequiredFieldValidator1">
                                                    </asp:ValidatorCalloutExtender>
                                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" Display="None"
                                                        ControlToValidate="txtUsername" CssClass=" validators" ErrorMessage="Please Enter Valid Email ID"
                                                        ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                                                    <asp:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="server" TargetControlID="RegularExpressionValidator1">
                                                    </asp:ValidatorCalloutExtender>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="tdHclass" align="center">
                                                    <asp:Label ID="lblPassword" runat="server" Text="Password" CssClass="lableform"></asp:Label>
                                                </td>
                                                <td class="tdMclass">
                                                    :
                                                </td>
                                                <td class="tdRclass">
                                                    <asp:TextBox ID="txtPassword" runat="server" TextMode="Password" onfocus="spnmsg()"></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtPassword"
                                                        Display="None" ErrorMessage="Please Enter your Password"></asp:RequiredFieldValidator>
                                                    <asp:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" TargetControlID="RequiredFieldValidator2">
                                                    </asp:ValidatorCalloutExtender>
                                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" Display="None"
                                                        CssClass=" validators" ErrorMessage="Password length minimum: 7 & alphanumeric characters required."
                                                        ControlToValidate="txtPassword" ValidationExpression="(?!^[0-9]*$)(?!^[a-z]*$)^([a-z0-9@\$]{8,20})$"></asp:RegularExpressionValidator>
                                                    <asp:ValidatorCalloutExtender ID="ValidatorCalloutExtender5" runat="server" TargetControlID="RegularExpressionValidator2">
                                                    </asp:ValidatorCalloutExtender>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="tdHclass" align="center">
                                                    <asp:Label ID="lblLocation" runat="server" Text="Location" CssClass="lableform"></asp:Label>&nbsp;
                                                </td>
                                                <td>
                                                    :
                                                </td>
                                                <td class="tdRclass">
                                                    <asp:DropDownList ID="ddlLocation" runat="server" SkinID="location">
                                                        <%--<asp:ListItem>Admin</asp:ListItem>
                                                <asp:ListItem>Vashi</asp:ListItem>
                                                <asp:ListItem>Pune</asp:ListItem>
                                                <asp:ListItem>Dadar</asp:ListItem>
                                                <asp:ListItem>Santacruz</asp:ListItem>
                                                <asp:ListItem>Thane</asp:ListItem>--%>
                                                    </asp:DropDownList>
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="ddlLocation"
                                                        Display="None" ErrorMessage="Please select Location"></asp:RequiredFieldValidator>
                                                    <asp:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server" TargetControlID="RequiredFieldValidator3">
                                                    </asp:ValidatorCalloutExtender>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="3" class="small-Link" style="padding-left: 78px;">
                                                    <a href="javascript:void(0)" onclick="popup('PassPopup','blanket','0');return false;">
                                                        Forgot Password?</a>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="3" style="padding-left: 300px; border-color: red; border: 1px;" align="center">
                                                    <asp:Button ID="Button1" runat="server" Text="Submit" CssClass="btnnewclass" OnClick="btnSubmit_Click" />
                                                </td>
                                            </tr>
                                        </table>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </td>
            </tr>
        </table>
        <center>
            <div name="light" runat="server" id="blanket" style="display: none;" class="blanket">
            </div>
            <div id="PassPopup" style="display: none; background-color: White; padding: 2px"
                class="Popup">
                <table cellpadding="5px" border="0">
                    <tr>
                        <td align="left"  style="padding: 0" colspan="2">
                            <table style="height: 100%">
                                <tr>
                                    <td width="480px" align="left" colspan="0">
                                        <span>Forgot Password</span>
                                    </td>
                                    <td width="20px" align="center">
                                    </td>
                                    <td width="5px">
                                    </td>
                                    <td width="10px" align="right" style="white-space: nowrap; background-color: White;"
                                        valign="middle">
                                        <a href="javascript:void(0)" onclick="$('#PassPopup').fadeOut('slow');$('#blanket').fadeOut('slow');document.getElementById('txtuname').value='';document.getElementById('ErrorDiv').style.display='none';toggleDiv('div7', 0);"
                                            runat="server" id="lnkClose" style="color: white; border: 0">
                                            <img alt="" src="Images/newsletter_close.PNG" width="10px" align="right" height="10px"
                                                style="border: 0" title="Close" />
                                        </a>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td style="color: #0542AF; font-size: 12px" align="right" colspan="0">
                            Username :
                        </td>
                        <td align="left" colspan="0">
                            <span style="float: left; padding-right: 5px"></span>
                            <input type="text" id="txtuname" maxlength="100" onfocus="toggleDiv('div7', 0);"
                                style="width: 180px" />
                            <span style="float: left"></span>
                            <div id="div7" class="errorDiv" style="float: left; padding-right: 5px">
                            </div>
                        </td>
                    </tr>
                    <%--   <tr>
                        <td style="color: Black; font-size: 12px" align="right">
                            Login as
                        </td>
                        <td style="color: Black; font-size: 12px; text-align: left" align="right">
                            <asp:RadioButtonList ID="RtType1" runat="server" RepeatDirection="Horizontal" Width="100%"
                                TextAlign="Right">
                                <asp:ListItem Value="0" Selected="True" Text="Admin"></asp:ListItem>
                                <asp:ListItem Value="1" Text="Technical"></asp:ListItem>
                            </asp:RadioButtonList>
                        </td>
                    </tr>--%>
                    <tr>
                        <td colspan="2" align="center">
                            <div id="loading" style="display: none;">
                                <img src="Images/loading.gif" />Please wait...</div>
                        </td>
                    </tr>
                    <tr>
                        <td align="center" colspan="2">
                            <input type="button" id="Button2" value="SUBMIT" onclick="sendPassword();" class="btnnewclass" />
                        </td>
                    </tr>
                    <tr>
                        <td align="left" colspan="2" width="100%">
                            <div id="ErrorDiv" class="spanErrorMsgs" style="display: none; width: 380px;">
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </center>
    </div>
    </form>
</body>
</html>
